<template>
  <div class="logo-container">
    <img class="logo" src="../assets/logo2.png" alt="logo" @click="handleLogoClick" />
  </div>
</template>

<script setup>
import { ref } from 'vue'

// 连续点击计数和时间跟踪
const clickCount = ref(0)
const clickTimer = ref(null)

// 处理logo点击事件
const handleLogoClick = () => {
  clickCount.value++
  
  // 清除之前的定时器
  if (clickTimer.value) {
    clearTimeout(clickTimer.value)
  }
  
  // 如果点击次数达到3次，打开开发者工具
  if (clickCount.value >= 3) {
    if (window.api && window.api.devTools) {
      window.api.devTools.open()
    }
    clickCount.value = 0
    return
  }
  
  // 设置定时器，如果在1秒内没有再次点击，重置计数
  clickTimer.value = setTimeout(() => {
    clickCount.value = 0
  }, 1000)
}
</script>

<style scoped>
.logo-container {
  width: 200px;
  display: flex;
  align-items: center;
}

.logo {
  width: 100%;
  cursor: pointer;
}
</style>
